Question 1: Number of Attacks per year

We have arranged both charts for 1 and 2 just because the explanation for both the queries becomes easy.

As we can see that the number of terrorist attack are growing as the timeline goes forward.

  1. A probable cause would be the advancement in technology and the development of new materials i.e. advancement in chemical warfare etc.

  2. Second can be the advancement in media i.e. due to advancement in media.

  3. Third can be political reasons. Example can be given of the Naxalites terror in the northern regions in India.

  4. Socioeconomic causes like poverty is also influencing the terrorism to great extent.People with strong economic background are being targeted by the groups of people with lower economic background to acquire there wealth and technology.

  5. Apart from these we can see that every terror attack Constitutes of bombings rather than any other means of terror attack like mass executions by gunning people, This is just because bombs are an efficient way to terrorise more people or rather a mass population.

  6. Also, the bombs are nowadays more advanced and easily concealable, like the chemical bombs which can be easily made from normal chemicals.And there are nail bombs which can be mad from only a pressure cooker can you imagine.

So, these were some probable causes for the increase in terror attacks and the increase in use of bombings as a terror device.

q1_td=terrorist_data%>%group_by(iyear)%>%summarise(No_of_Terrorist_attacks=n())


q1_ggplot=ggplot(q1_td,aes(x=iyear,y=No_of_Terrorist_attacks))+
  geom_area(fill="light blue")+
  geom_point(col="black",size=0.9) + labs(subtitle="X-Axis:Year\nY-Axis:Number of terrorist attacks", 
               y="Number of Terrorist attacks", x="Year", title="Number of Attacks per year", 
               caption = "Source: Global Terrorism Database")
  

ggplotly(q1_ggplot)

##Questions2: Number of bombing per year

q2_td=terrorist_data%>%
  filter(attacktype1_txt=="Bombing/Explosion")%>%
  group_by(iyear)%>%
  summarise(no_of_terrorist_bombings=n())
## Warning: package 'bindrcpp' was built under R version 3.4.4
q2_ggplot=ggplot(q2_td,aes(x=iyear,y=no_of_terrorist_bombings))+
  geom_area(fill="light green")+
  geom_point(size=0.9) + labs(subtitle="X-Axis:Year\nY-Axis:Number of terrorist bombings", 
               y="Number of Terrorist Bombings", x="Year", title="Number of Bombings per year", 
               caption = "Source: Global Terrorism Database")
 
ggplotly(q2_ggplot)
grid.arrange(q1_ggplot,q2_ggplot)

Question-3: Terrorist attacks region wise per year

  1. As we can see there is variation of attacks respective to the following regions defined.

  2. Regions like South Asia which have a higher rate of increase in terror attack also tells us that it has larger surface area prone to terror attack and also a large population to be terrorised.

  3. While countries like South Asia and Africa have an increased rate of terror attacks, We see that regions like North and South America are very well doing in combating terrorism and have a decreasing rate of terrorist attack

q3_td=terrorist_data%>%group_by(region_txt,iyear)%>%summarise(No_of_attacks_each_year=n())


q3_ggplot=ggplot(q3_td,aes(x=iyear,y=No_of_attacks_each_year))+
  geom_area(aes(fill = as.factor(region_txt)))+
  theme_bw() + facet_wrap(~region_txt, scales="free_y",ncol=3)+
  geom_point(col="black",size=0.9)+
  theme(legend.position="none")+
  theme(axis.title.x=element_blank(),
        axis.title.y=element_blank())+
  theme(panel.spacing = unit(2, "lines")) + 
  labs(subtitle="X-Axis:Year\nY-Axis:Number of attacks each year", 
        y="Number of attacks each year", x="Year",
        title="Terrorist attacks region wise per year", 
          caption = "Source: Global Terrorism Database", fill = "Region")

ggplotly(q3_ggplot)

Question 4: Top 5 type of terror attacks per region

  1. It is clear by seeing the plotting that bombing and explosions are being mainly used as a terror method in every region either small or large. The probable cause can be advancement in the bomb making technology and the amount of destruction caused by it.

  2. Second most prevalent attack type is clearly armed assaults because of easy availability of arms in the following regions. It might be the cause of a weak arms act or the smuggling of arms to different regions.

  3. Facility and infrastructure attacks with Assassinations can become the third most prevalent attack types. Probable causes are assassinations of political leaders in a high scale might be to overthrow government. Also the infrastructures are targeted so that high amount of property damage is done

q4_td=terrorist_data%>%group_by(region_txt,attacktype1_txt)%>%
  summarise(No_of_attacks=n())%>%
  top_n(5)
## Selecting by No_of_attacks
q4_ggplot=ggplot(q4_td,aes(x=attacktype1_txt,y=No_of_attacks))+
  geom_bar(stat = "Identity",width = .5, aes(fill = as.factor(attacktype1_txt)))+
  theme_bw() + facet_wrap(~region_txt, scales="free",ncol=3)+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())+
  theme(panel.spacing = unit(1, "lines")) 


q4_ggplot = q4_ggplot + labs(subtitle="X-Axis:Year\nY-Axis:Number of attacks", 
               y="Number of attacks", x="Attack Type",
               title="Top 5 type of terror attacks per region", 
               caption = "Source: Global Terrorism Database", fill="Attack Type")
q4_ggplot

Question 5: Heaviest hit Target types (Based on both Killed and wounded)

  1. Terrorist main target is seen to be to do maximum damage to private citizen and properties.
  2. Inferring from the graph Wounds and killed in Police are high as they are first responders to any terrorist attacks and they are responsible for law and order at the ground level so this make them in direct line of attack from terrorists

  3. Similarly Government Military forces work mostly in warzones resulting in higher casualties

q5_td=terrorist_data%>%
  group_by(targtype1_txt)%>%summarise(maximum_kills=sum(nkill,na.rm = TRUE),maximum_wounded=sum(nwound,na.rm = TRUE))



q5_ggplot=q5_td%>%gather(-targtype1_txt,key="var",value="value")%>%
  ggplot(aes(x=targtype1_txt,y=value))+
  geom_bar(stat = "Identity",aes(fill=as.factor(targtype1_txt))) +
  facet_wrap(~ var, scales = "free") +
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())+
  theme(panel.spacing = unit(3, "lines"))
q5_ggplot = q5_ggplot + labs(subtitle="X-Axis:Target Type\nY-Axis:Number of attacks", 
                y="Number of attacks", x="Target Type", title="Heaviest hit target types (Based on both Killed and wounded)", 
                caption = "Source: Global Terrorism Database", fill = "Target Type")

ggplotly(q5_ggplot)

Question 6: Terrorist attack in India and Pakistan in last 45 years

  1. Total number of terrorist attack over 45 years in Pakistan and India are approximately equal

  2. Till 2006, average number of total terrorist attacks in India is higher than that of Pakistan, After 2006, total number of attacks and number of casualties have increased drastically in Pakistan and significantly higher than India

  3. We can contribute to higher attacks in India Pre 2006 mainly due to combination of Naxal related attacks, NE insurgency, Kashmir attacks and other internal problems

  4. After 2006, there is multi-fold increase in number of attacks in Pakistan which is mainly attributed to blow back from ‘War on Terror’ in Afghanistan and Pakistan

q6_td=terrorist_data%>%filter(iyear!=1970)%>%
  filter(country_txt=="India" | country_txt=="Pakistan")%>%
  group_by(iyear,country_txt)%>%summarise(No_of_Attacks=n())

q6_ggplot=ggplot(q6_td,aes(x=iyear,y=No_of_Attacks))+
  geom_area(aes(fill=as.factor(country_txt)))+geom_point()+
  theme_bw() + facet_wrap(~country_txt,scales = "free")+
  theme(panel.spacing = unit(3, "lines"))+
  theme(axis.title.x = element_blank(),axis.title.y = element_blank())

q6_ggplot = q6_ggplot + labs(subtitle="X-Axis:Year\nY-Axis:Number of attacks", 
                 title="Terrorist attack in India and Pakistan in last 45 years", 
                 caption = "Source: Global Terrorism Database", fill = "Country")

ggplotly(q6_ggplot)

Question 7: Terror attack in United States vs Russian Federation/USSR in last 45 years

After the breaking of USSR among smaller countries the number of terror attacks in the region increased significantly. United States faced worst attacks till 9/11 and after that the intensity and number of attacks fell down drastically which resulted in influx of terror attack in many other regions of Russian Federation

q7_td=terrorist_data%>%filter(iyear!=1970)%>%
  filter(country_txt=="Russia" | country_txt=="United States")%>%
  group_by(iyear,country_txt)%>%
  summarise(No_of_Attacks=n())


q7_ggplot=ggplot(q7_td,aes(x=iyear,y=No_of_Attacks))+
  geom_area(stat = "Identity",width = .5,aes(fill=as.factor(country_txt)))+
  theme_bw() + facet_wrap(~country_txt,scales = "free")+geom_point()
## Warning: Ignoring unknown parameters: width
q7_ggplot = q7_ggplot + labs(subtitle="X-Axis:Year\nY-Axis:Number of attacks", 
                 y="Number of attacks", x="Year", title="Terror attack in United States vs Russian Federation/USSR in last 45 years", 
                 caption = "Source: Global Terrorism Database", fill = "Country")
q7_ggplot

Question-7 graph 2

q7_ggplot2=ggplot(q7_td,aes(x=iyear,y=No_of_Attacks))+
  geom_bar(stat = "Identity",width = .5,aes(fill=as.factor(country_txt)))+
  theme_bw()

q7_ggplot2

Question-8: Where are there the most casualties?

  1. Most of the casualties are in the middle east region because of the growing in house terror groups and number of attempts to destabilize the region particularly by US and its allies.

2)It is due to the continued failed effort of United Nations to stop these from making the region unstable and war-torn. In other regions namely - Afghanistan and Pakistan this is the one of the reason

q8_select=terrorist_data%>%select(country_txt,nkill)

q8_td=q8_select%>%filter(!is.na(country_txt),country_txt!=".")%>%
  group_by(country_txt)%>%summarise(maximum_kills=sum(nkill,na.rm = TRUE))%>%
  arrange(-maximum_kills)%>%
  head(10)


q8_ggplot=ggplot(q8_td,aes(x=country_txt,y=maximum_kills))+
  geom_bar(stat="Identity",width=0.5,aes(fill=as.factor(country_txt)))+
  theme(axis.text.x = element_text(angle = 90, hjust = 1))


q8_ggplot = q8_ggplot + labs(subtitle="X-Axis:Countries\nY-Axis:No. of Casualties", 
                 y=":No. of Casualties", x="Countries", title="Where are more Casualties", 
                 caption = "Source: Global Terrorism Database", fill = "Country")

q8_ggplot

Question 9: How have casualties evolved throughout the years?

Causalities throughout the year had evolved region wise. Since the beginning of 21st century it had become more of concentrated in the region of Libya, Syria, Iraq, Pakistan, and Afghanistan. The count of casualties evolved region wise and year wise in a hierarchical order.

-> The about 50% causalities that happened were carried out majorly buy 5 Group namely:

->Al-qaida in Iraq

->Boko Haram

->Islamic State of Iraq and the Levant (ISIL)

->Liberation Tigers of Tamil Eelam (LTTE)

->Shining Path

->Tailban

q9_td=terrorist_data%>%group_by(iyear) %>%
  summarise(total.casualties = sum(nkill+nwound, na.rm = TRUE))
View(q9_td)


q9_ggplot=ggplot(q9_td,aes(x=iyear,y=total.casualties))+
  geom_area(fill = "#cc99ff")+ geom_point()+
  labs(subtitle="X-Axis:Year\nY-Axis:Total casualties", 
        y="Total casualties", x="Year", title="Total casualties over the years", 
        caption = "Source: Global Terrorism Database")

ggplotly(q9_ggplot)

Self-confilict vs Non Self Conflict

1.) This Graph depicts how the causalities have evolved over the year. Dividing it into Self conflict countries and non-self conflict countries.

2.)self comflict countries show a exponential increase in the last 10 years . compared to non-conflict Countries.

conflict=terrorist_data%>%filter(!is.na(INT_ANY),INT_ANY!=-9)%>%group_by(iyear,INT_ANY) %>%
  summarise(total.casualties = sum(nkill+nwound, na.rm = TRUE))
  

conflict_ggplot=ggplot(conflict,aes(x=iyear,y=total.casualties))+
  geom_line(size=1,stat="identity",aes(col=as.factor(INT_ANY)))+geom_point()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())


ggplotly(conflict_ggplot)

Question-10: What are the casualties by weapon type?

  1. By seeing the graph it is clear that bombing by dynamite or other types of explosives are the main terror spreading weapon. This might be because of amount of terror it spreads.
  2. We can imply by the other constraint that terror spread by firearms is the second most prevalent attack type and the reasons are listed above.
  3. Other prevalent attack types are by incendiary, Melee and unknown attack types.
q10_select=terrorist_data%>%select(iyear,weaptype1_txt,nkill)

q10_td=q10_select%>%
  group_by(weaptype1_txt)%>%
  summarise(Total_Kills=sum(nkill,na.rm = TRUE))%>%
  arrange(-Total_Kills)

q10_head6=q10_td%>%head(6)

q10_tail6=q10_td%>%tail(6)

a10=ggplot(q10_head6,aes(x=weaptype1_txt,y=Total_Kills))+
  geom_bar(stat="identity",aes(fill=as.factor(weaptype1_txt)))+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())+
  theme(legend.position="bottom")

b10=ggplot(q10_tail6,aes(x=weaptype1_txt,y=Total_Kills))+
  geom_bar(stat="identity",aes(fill=as.factor(weaptype1_txt)))+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())+
  theme(legend.position="bottom")

grid.arrange(a10,b10)

Question-11: Are certain nationalities more targeted? If yes, which one?

  1. We can see that the top 10 targeted nationalities are same as the top 10 countries where terrorist attacks happen.

  2. We can refer from the chart that the residents of the country where the terrorist attacks happen are the most affected nationalities.

q11_select=terrorist_data%>%select(iyear,natlty1_txt,nkill)



q11_td=q11_select%>%
  group_by(natlty1_txt)%>%
  summarise(Total_Kills=sum(nkill,na.rm = TRUE))%>%
  arrange(-Total_Kills)%>%head(10)


q11=ggplot(q11_td,aes(x=natlty1_txt,y=Total_Kills))+
  geom_bar(stat="identity",aes(fill=as.factor(natlty1_txt)))+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())

ggplotly(q11)

Which nationalities are Targeted internationally and which nationalities are targetted locally.

q11_select=terrorist_data%>%select(natlty1_txt,nkill,INT_MISC)



q11_td=q11_select%>%filter(INT_MISC!= -9,!is.na(INT_MISC))%>%
  group_by(natlty1_txt,INT_MISC)%>%
  summarise(Total_Kills=sum(nkill,na.rm = TRUE))%>%
  ungroup%>%
  group_by(INT_MISC)%>%
  top_n(10)%>%arrange(-INT_MISC)
## Selecting by Total_Kills
q11=ggplot(q11_td,aes(x=natlty1_txt,y=Total_Kills))+
  geom_bar(stat="identity",aes(fill=as.factor(natlty1_txt)))+
  facet_wrap(~as.factor(INT_MISC), scales="free",ncol=3)+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())

ggplotly(q11)

Question 12: Are some countries better at defending themselves against terrorist attacks? If yes, which is the safest country to live

  1. We can infer from the chart that 7 out of 10 countries are developed countries. So, military expenditure used for counter-terrorism is as high as 5% of GDP in some countries.

  2. USA and it’s allies work closely to counter terrorism by working closely among government agencies to stop terrorism.

bsafest_nation = terrorist_data %>% 
  group_by(country_txt) %>% 
  summarise(total = n(), total.failure = sum(success == '0'), percentage_attack = ((total.failure/total))*100)%>%
  filter(total>50)%>%
  arrange(-percentage_attack)%>% head(10)


bsafest_nation = bsafest_nation[order(-bsafest_nation$percentage_attack), ]
bsafest_nation$country_txt = factor(bsafest_nation$country_txt, levels = bsafest_nation$country_txt)

q12_ggplot=ggplot(bsafest_nation, aes(x = country_txt, y = percentage_attack)) + geom_bar(stat="identity", aes(fill=country_txt))+
theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank())+
labs(subtitle="X-Axis:Country\nY-Axis:Percentage attack failure", 
        y="Percentage attack failure", x="Country", title="Safest country in terms of terroism prevention", 
        caption = "Source: Global Terrorism Database")

ggplotly(q12_ggplot)